package com.ws.game.common.components
{
	import com.ws.game.common.errors.NotImplementError;
	import com.ws.game.common.framework.BaseGameScene;
	
	import flash.events.Event;
	
	import mx.core.UIComponent;
	
	public class SpriteLoader extends UIComponent
	{
		protected var gSce : BaseGameScene;
		public function SpriteLoader()
		{
			super();
			this.setStyle("left",0);
			this.setStyle("right",0);
			this.setStyle("bottom",0);
			this.setStyle("top",0);
			this.addEventListener(Event.ADDED_TO_STAGE,onAddToStage);
		}
		
		private function onAddToStage(event:Event):void{		
			this.removeEventListener(Event.ADDED_TO_STAGE,onAddToStage);
			gSce = new BaseGameScene(this.parent.stage);
			this.addChild(gSce);
			addGameObjects();
		}
		
		protected function addGameObjects():void{
			throw new NotImplementError("addGameObjects");
		}
	}
}